home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
2000.ZIP
/
PROCLIP.ZIP
/
PROCLIP2.DOC
next >
Wrap
Text File
|
1988-02-29
|
170KB
|
5,281 lines
PROCLIP2.LIB
- The Professional Clipper Library -
Version 2.00
By
Jason R. Matthews
February 15, 1988
**********************************
* Programming extensions for *
* NANTUCKET CLIPPER SUMMER '87 *
**********************************
- Table of Contents -
========================================================================
COPYRIGHTS Acknowledgments.........................................v
DISCLAIMER "As is".................................................v
OVERVIEW General overview.......................................vi
REGISTRATION How to become a "registered user."....................vii
USAGE General syntax of functions..........................viii
CAUTIONS Indicates possible conflicts.........................viii
LINKING With Microsoft, Plink86 or Turbo Link...................x
ERROR
HANDLING Internal critical error handling functions.............xi
SYNTAX
CONVENTIONS PROCLIP2 Documentation syntax conventions............xiii
- i -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
- Table of Contents -
BORDER Using the color as set in the SET COLOR TO...,
activates the screen border on CGA and VGA
monitors................................................1
BOXCOLOR Change the color attribute of the border of a
"window" on the screen without having to
rewrite the BOX.........................................3
CLOCK Display a dynamic clock anywhere on the screen
using selectable colors and format......................6
CURSOR Set cursor to full, half, standard or any user
selectable size or completely disable cursor
from the current video screen...........................9
ERASTEXT Erase all text characters from within a
specific area of the screen. Great for erasing
lines containing graphics characters you wish
to retain..............................................12
FILEATTR Set or reset a file's directory attributes.............14
GETCOLOR Obtain the current foreground and background
color attribute from the position requested............17
ISCGA Indicates if the attached monitor is driven by
a standard Color Graphics Adapter (CGA)................19
ISEGA Indicates if the attached monitor is driven by
a standard Enhanced Graphics Adapter (EGA).............20
ISMONO Indicates if the attached monitor is driven by
a standard Monochrome Adapter (MDA)....................21
ISVGA Indicates if the attached monitor is driven by
a standard Video Graphics Array Adapter (VGA)..........22
NEWCOLOR Change the color attribute of a "window" on the
screen without having to rewrite the data..............23
PRTSC Provides print screen and print screen
translation facilities.................................26
RESET Provides an instant hardware or software reset
of the computer........................................29
- ii -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
- Table of Contents -
RESTBOX Restore a "window" area of the screen to the
original, or different, screen location using
original, or different screen colors...................31
RESTCURS Restore the cursor to the shape and position
when it was saved into a numeric memory
variable with SAVECURS.................................34
SAVEBOX Save a "window" area of the screen into a
character memory variable..............................35
SAVECURS Save the current cursor shape and position.............37
SCROLL See VSCROLL
SDIR Read the directory entry by entry obtaining the
filename, file update date & time and current
file size using attributes specified...................39
SOUND Allows generation of a wide range on sounds for
variable durations. Similar to Clipper's
TONE() command but with more flexibility on the
duration...............................................44
SPRINT Prints a given string onto the screen using
selectable color attributes without issuing a
SET COLOR TO command. Optionally resets the
cursor position or not.................................47
STAMP Provides date and time stamping capabilities to
any file...............................................50
UNRESET Intercepts CTRL ALT DEL to either prevent or
warn the user of the attempt...........................52
VIDEO Turn on or off the video screen........................54
VSCROLL Provides vertical and horizontal scrolling with
full control over the color attribute used
during the scroll......................................56
- iii -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
- Table of Contents -
WILDAT Search a target string for the first occurrence
of another string or wildcard pattern
optionally ignoring case, in a left to right
search. ...............................................59
WILDRAT Search a target string for the first occurrence
of another string or wildcard pattern
optionally ignoring case, in a right to left
search.................................................63
- iv -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Copyright Acknowledgments -
------------------------------------------------------------------------
CLIPPER is a Trademark of Nantucket, Corp.
IBM is a Trademark of International Business Machines.
Tom Rettig Library is a Trademark of Tom Rettig Assoc.
Microsoft Overlay Linker is a Trademark of Microsoft Corp.
PLINK86 & PLINK86plus are Trademarks of Phoenix Technologies, Ltd.
Turbo Link is a Trademark of Borland International.
Intel is a Trademark of Intel Corporation.
All references in this documentation to trademarks, copyrights,
registered names or the like are intended only as a reference and do not
contain any inference.
******************************************************
* The author is not associated with Nantucket, Corp. *
******************************************************
------------------------------------------------------------------------
- Software Disclaimer -
------------------------------------------------------------------------
Although a great deal of time and effort have been spent designing,
coding and debugging these functions, it cannot be certain that they are
totally error free. It should be clearly understood that PROCLIP2 is
released "as is". The author makes no warranties, express or implied,
with respect to this software, including without limitation, warranties
of merchantability and fitness for a particular purpose. In no event
shall the author be liable for any direct, indirect or consequential
damages, real or imagined.
- v -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Overview -
------------------------------------------------------------------------
The Professional Clipper Library (PROCLIP2), Version 2.00, is designed
for the CLIPPER programming language (Summer '87 release) from
Nantucket, Corp. It is for the programmer who desires more than the
current language specifications can support. PROCLIP2 is not designed
to replace the standard Nantucket Clipper Library, but to provide
enhanced capabilities in those areas Nantucket chose not to. Some of
the functions provided by PROCLIP2 will undoubtedly be made available in
future releases of Clipper, but the need to utilize them in application
development is today and PROCLIP2 was designed to meet some of those
needs. As with any language, Clipper contains features and functions
which are unique to it and therefore make it more attractive. By the
same token, it lacks features which may appear to be "standard" in other
languages and thus makes it somewhat frustrating to use from time to
time. While PROCLIP2 does not, and indeed cannot, solve all of these
frustrations it will help where it can.
Care has been taken to utilize only published and supported accesses
into Clipper in an effort to ensure upward compatibility with future
releases of Clipper. Some of the routines contained within PROCLIP2 are
similar in name to those provided by Nantucket or another creator of
add-on libraries, Tom Rettig Assoc. Each function has been created with
the concept of enhancing existing functions and procedures regardless of
their origin. All functions contained within PROCLIP2 have been coded
in Intel 8088/8086 assembly language for compactness of code, execution
efficiency and compatibility through all Intel microprocessors.
- vi -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Registration -
------------------------------------------------------------------------
A good deal of effort, time and money have been spent designing,
creating and supporting PROCLIP2. If these functions are of use, and
you would like to support the creation of more, a donation to help
defray these costs is greatly appreciated. For a donation of US $25.00
you may become a "registered user" of PROCLIP2 and will receive
notification of upgrades prior to release to the general public as well
as notification of any programmer errors discovered. Input to define
and develop useful functions to be added into PROCLIP2 are always
solicited.
Send all requests, registrations and suggestions to:
Jason Matthews
P.O. Box 1296
Rowlett, Texas 75088
Source: NAN779
CompuServe: 71410,2051
- vii -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Usage Format -
------------------------------------------------------------------------
As Nantucket was kind enough to provide the facility to create User
Defined Functions (UDF), all of the PROCLIP2 functions utilize this
format. Programmed into most of the functions is a sub-function which
validates parameter count, type and contents prior to attempting
function execution. Hopefully this will resolve runtime errors. If a
PROCLIP2 function is called and nothing seems to happen it quite
probably was ignored due to a parameter difficulty. Almost all of
PROCLIP2s functions use the published Clipper vector names contained in
the EXTENDA.MAC released with Clipper. Hopefully this will prevent
PROCLIP2 from becoming obsolete when Nantucket releases future versions
of their language.
------------------------------------------------------------------------
- Cautions, Warnings & Compatibility -
------------------------------------------------------------------------
- Environment Compatibility -
Some of the functions contained in PROCLIP2 assume they are operating in
an IBM (or 100% compatible) system utilizing DOS 2.xx or greater, OS/2
in "real" mode or Microsoft Windows. What this means is that they will
access the ROM BIOS or perform DMA (direct memory access) from time to
time to perform specific functions or obtain information regarding the
current system environment. As long as you are using an IBM (or 100%
compatible) with the proper version of DOS you should experience no
difficulties.
- Monitor Compatibility -
PROCLIP2 is intelligent enough to determine the current monitor type and
treat it accordingly. This includes Monochrome, Color Graphics (CGA),
Enhanced Graphics (EGA) and Video Graphics (VGA) monitors in either
native or emulated modes. Those functions which offer DMA video buffer
updating should be tested on the system prior to releasing it for use.
These functions are again assuming they are operating in an IBM-type
environment and so they "know" where the video buffer currently resides.
DMA updating is useful when operating in personal computers which have a
clock speed slower than 8MHz. If one of the screen functions appears to
be operating sluggishly try attempting the DMA update request specified
in the function.
- viii -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Cautions, Warnings & Compatibility (cont'd) -
------------------------------------------------------------------------
- Memory Compatibility -
Some functions within PROCLIP2 require a temporary allocation of memory
from the system. If this allocation is not possible the function will
refuse to function. The typical allocation request is less than 1Kb
(1024 bytes) so no real conflict should exist. Once memory has been
allocated and used by PROCLIP2 it will be returned to the system memory
pool for use by other programs or DOS. PROCLIP2 will not attempt to
allocate any memory outside of the standard 640Kb limit.
- System / BIOS dependent functions -
Some functions are dependent upon system level functions or internal
BIOS interrupt vectors. These functions, when active, have the ability
to "hang" the computer if a serious error occurs in the system.
PROCLIP2 will intercept DOS level critical errors before DOS is made
aware of them and make every effort to restore any interrupt vectors or
system functions to their previous state before passing the error to DOS
for handling. This feature of PROCLIP2 is unique to PROCLIP2 as it
requires no additional coding or intervention on your part. When a
function is activated which depends on interrupt or system vectors (eg.
CLOCK) it will automatically create the "hook" into the DOS critical
error handler. Should a critical error occur all PROCLIP2 functions
which are using interrupt or system vectors will be deactivated by
PROCLIP2.
- ix -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Linking PROCLIP2 -
------------------------------------------------------------------------
Use of this library is identical to that of any other library designed
for use with CLIPPER or other programming languages. Refer to the
Clipper programming manual or any manual containing a description of how
to operate the linker you are currently using.
Listed below are sample syntax for three of the most popular linkers.
With MicroSoft Overlay Linker -
C>LINK
Microsoft (R) Overlay Linker Version 3.61
Copyright (C) Microsoft Corp 1983-1987. All rights reserved.
Object Modules [.OBJ]: YOURPROG
Run File [YOURPROG.EXE]:
List File [NUL.MAP]:
Libraries [.LIB]: CLIPPER + PROCLIP2
With Plink86 -
C>PLINK86
PLINK86plus ( Nantucket ) Version 2.24
Copyright (C) 1987 by Phoenix Technologies Ltd.,
All Rights Reserved.
=>FI YOURPROG
=>LIB CLIPPER
=>LIB PROCLIP2
=>;
With Turbo Link -
C>TLINK YOURFILE,YOURFILE,NUL,CLIPPER + PROCLIP2
Turbo Link Version 1.0 Copyright (c) 1987 Borland International
* * * NOTE * * *
If you are using PROCLIP2 with any other library which contains the same
function names (eg. CLOCK) you will see some warning errors generated by
whichever linker you are using. If you like the PROCLIP2 function
better than the others just make certain that PROCLIP2 is the first
library in the list after the CLIPPER library is specified. Otherwise
make certain their library is first in the list.
- x -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Error Handling -
------------------------------------------------------------------------
PROCLIP2 currently contains three functions which intercept low level
(BIOS) interrupt vectors to perform their functions. They are:
* CLOCK
Intercepts INT 08H, which is the timer interrupt. This
interrupt was chosen over the more typical INT 1CH in order to
make it more usable under some TSR's which never relinquish
INT 1CH. The CLOCK routine calculates the time at every timer
tick (18.2 times per second).
* PRTSC
Intercepts INT 05H, which is the print screen interrupt.
PRTSC uses this interrupt vector to replace the standard BIOS
print screen with the translation facilities of PROCLIP2.
* UNRESET
Intercepts INT 09H, which is the basic keyboard interrupt.
UNRESET requires access at this level in order to prevent the
CTRL ALT DEL sequence from resetting the computer.
With these three routines, and more to be included in subsequent
releases of PROCLIP2, it became evident that some type of error handling
was necessary. Clipper Summer '87 now contains an extensive runtime
error handling function to intercept most errors and allow your
application to determine the best course of action. While each of the
PROCLIP2 functions contains an "off" command, a given application could
not be expected to intercept every possible error condition. In light
of this, PROCLIP2 now contains it's own built-in critical error handling
system. The error handling system in PROCLIP2 is designed specifically
for these interrupt driven routines, nothing more. When a critical
error is declared by the operating system (as in drive failure), the
PROCLIP2 critical error routine will automatically "unhook" all
interrupt driven routines. The interrupt vectors in BIOS and DOS will
be restored to their original state and the PROCLIP2 interrupt driven
functions will cease their operation immediately. This feature is
unique to PROCLIP2 in that no additional programming is necessary.
There is no need for you to remember which functions are currently
active, PROCLIP2 maintains it's own internal table and uses it to
process the error handling. As an additional feature, you can invoke
the PROCLIP2 error recovery system by yourself. Application error
trapping is great, but sometimes it can determine the best course of
action is a rapid termination of the program.
- xi -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ERROR HANDLING (cont'd)
BAILOUT
-------
The BAILOUT function should only be used when a runtime error has
occurred which the application program determines is unrecoverable.
Invoking the BAILOUT function effectively terminates all PROCLIP2
interrupt driven functions.
Format:
bailout()
Parameters:
None.
Example:
1. The ERRORSYS.PRG has determined that a runtime error is
unrecoverable. Before quitting the program any interrupt
driven PROCLIP2 functions need to be disabled.
.
.
.
bailout()
.
.
quit
Returns:
Nothing.
- xii -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
------------------------------------------------------------------------
- Syntax Conventions -
------------------------------------------------------------------------
The follow are the syntax conventions used throughout the PROCLIP2
documentation.
[...] Indicates an optional parameter. Any parameter surrounded by
square brackets should be considered optional. All optional
parameters have a default.
'...' Indicates a parameter string. A parameter string is a word or
phrase used to inform the function of a certain request, as in
'on' or 'off'. All examples use lower case but case is not
sensitive in any of the PROCLIP2 functions which use a
parameter string.
| Indicates an exclusive or. In other words, multiple
parameters separated by the | character are mutually exclusive
and cannot be used in the same function call, as in 'on' |
'off'.
Example:
As this function employs all syntax possibilities, it is the best to
discuss in an example.
cursor(['std' | 'off' | 'half' | 'full'] | [start,end])
[...] The parameters surrounded by square brackets are optional in
that they are not necessary for the function to operate in
default mode. When two or more parameters are enclosed within
the same bracket pair they are dependent upon each other in
one way or another.
'std' This, and the other parameters specified in this fashion, are
string parameters informing the function of the action to
take. This mechanism makes reading the resulting source code
easier as no "cryptic" codes need to be interpreted.
| All parameters separated by the "|" character are mutually
exclusive in that they cannot be used in the same function
call. Notice how all of the "pre-programmed" cursor sizes in
the example are grouped in the square brackets, but are also
mutually exclusive. Further, the "pre-programmed" sizes are
exclusive from the programmable size specified in the
[start,end] group.
- xiii -
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
BORDER
------
Although syntactically supported in the SET COLOR TO... command,
Clipper does not actually set the border color to the specified
color. BORDER provides this functionality to standard color (CGA)
and the new VGA monitors. EGA standards do not allow for border
color support but some EGA's will support them.
This function can either accept a standard Clipper color string or
an individual color string to set the border color.
Format:
border(aColor)
Parameters:
aColor....Character string variable or constant, non case
sensitive, which contains the color to use when
setting the border. Must be the alpha
representation of the color, the numeric will be
rejected. If the string is a standard Clipper color
command (eg. 'W/N,N/W,R,,N/W') the function will
locate the border color within the string position
as specified in the Clipper documentation.
Otherwise the function assumed the color for the
border is the string (eg. 'r').
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
Page #1
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
BORDER (cont'd)
Examples:
1. Set the colors, including the border, to a nice shade of
blue.
.
.
.
aColor = '+gr/b,b/gr,b,,n/w'
set color to &aColor
border(aColor)
.
.
.
2. Set the border to red without affecting anything else.
.
.
.
border('r')
.
.
.
Returns:
Nothing.
Cautions:
None.
Page #2
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
BOXCOLOR
--------
Changing the color attributes within a given area can be
accomplished with NEWCOLOR, but BOXCOLOR will only change the color
attribute of the border of the area. With an optional parameter
you can instruct the function to change the color of the first
column and last column inside the area thereby showing a more
appealing BOX. Changing the background color with BOXCOLOR you can
create your own "boxes" or even exploding and imploding emulation.
Format:
boxcolor(top,left,bottom,right,attr[,double][,type])
Parameters:
top.......Numeric variable or constant indicating the top row
of the area to be changed. Value checked to be
between 0 and 24 inclusive.
left......Numeric variable or constant indicating the left
column of the area to be changed. Value checked to
be between 0 and 79 inclusive.
bottom....Numeric variable or constant indicating the ending
row of the area to be changed. Value checked to be
greater than TOP but less than or equal to 24.
right.....Numeric variable or constant indicating the right
column of the area to be changed. Value checked to
be greater than LEFT but less than or equal to 79.
attr......Character string variable or constant, non case
sensitive, which contains a valid color command or
combination for character and background. Must be
the alpha representation of the color, the numeric
will be rejected.
Page #3
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
BOXCOLOR (cont'd)
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
intense +
blink *
double....OPTIONAL. Character string variable or constant,
non case sensitive, which instructs the function to
change the attribute of the first and last columns
within the area specified. As columns are "slimmer"
than rows, changing these columns as well causes a
more appealing border.
'd' This is the only valid parameter.
Any other letter will be rejected as
a bad parameter.
type......OPTIONAL. Logical variable or constant instructing
the function to use DMA updating or not.
.T. DEFAULT. If not specified, the
function will use DMA screen
updating.
.F. Setting this flag to a logical false
will cause the function to use the
standard BIOS INT 10H for screen
updating.
Examples:
1. Change the color of the border of an area.
.
.
.
boxcolor(05,05,10,10,'n/w')
.
.
.
Page #4
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
BOXCOLOR (cont'd)
1. Change the color of the border of the same area, but use
double wide columns.
.
.
.
boxcolor(05,05,10,10,'n/w','d')
.
.
.
Returns:
Nothing.
Cautions:
None.
Page #5
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
CLOCK
------
Many programmers have wanted to display the current time on the
screen from with Clipper, but due to the overhead involved in
trying to keep it correct have dismissed the idea. Now, with
CLOCK, you simply specify the location, format and color attributes
and PROCLIP2 will maintain the dynamic clock for you. Formats
include military (24 hour) or meridian (12 hour), with or without
seconds displayed. If no seconds are selected the colon between
the hour and minutes will pulse every second re-enforcing the fact
that it is keeping time.
Format:
clock('on' | 'off' [,format] [,seconds][,attr] )
Parameters:
'on'......Character string variable or constant, non case
sensitive, which instructs the CLOCK to become
active at the current cursor position. Mutually
exclusive with the "off" parameter.
'off'.....Character string variable or constant, non case
sensitive, which instructs the CLOCK to deactivate
itself. The constant updating of the clock will
cease but the clock will remain on the display.
Mutually exclusive with the "on" parameter.
attr......OPTIONAL. Character string variable or constant,
non case sensitive, which informs the function what
color attributes to use when displaying. If not
specified the function will use the attribute
currently displayed on the screen at the position
indicated.
Page #6
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
CLOCK (cont'd)
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
intense +
blink *
format....OPTIONAL. Character string variable or constant,
non case sensitive, which informs the function of
the display format to use.
'12 hour' DEFAULT. Instructs the CLOCK
function to display in standard 12
hour format (eg. 10:00pm)
'24 hour' instructs the CLOCK function to
display in military format (eg.
22:00)
seconds...OPTIONAL. Character string variable or constant,
non case sensitive, which informs the function
whether to display the current seconds or not.
'seconds' instructs the CLOCK function to
display the seconds in the current
format.
'no seconds' DEFAULT. Instructs the CLOCK
function to suppress display of the
seconds and activate the pulse of the
colon separator in hh:mm
Page #7
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
CLOCK (cont'd)
Examples:
1. At row #00 and column #00 display the clock in military
format with the seconds displayed using a white
background with black characters.
.
.
.
@ 0,0 say clock('on','24 hour','seconds','n/w')
.
.
.
2. Disable the clock.
.
.
.
clock('off')
.
.
.
Returns:
Nothing.
Cautions:
This function should not be placed into an overlay as it is
interrupt driven. Any error routines which determine an
unrecoverable runtime error has occurred should disable this
function prior to exiting the program. Failure to follow this
caution may result in the computer locking up.
Page #8
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
CURSOR
------
While Clipper contains a CURSOR command, it can't match the
flexibility of this one. CURSOR provides the programmer with full
cursor shape control as well as information regarding the current
cursor state.
To use the "pre-programmed" mode, simply tell CURSOR what type of
cursor you want. Choices are 'off', 'std', 'half' and 'full' size.
CURSOR will automatically adjust to different monitors so there is
no need to remember starting and ending scan lines.
For those programmers wishing even more control, CURSOR will accept
starting and ending scan lines to adjust the cursor shape
accordingly. This is an excellent way to get that "special" cursor
for your application.
The last function contained in CURSOR is revealed when no
parameters are used. No parameters informs CURSOR that you want
the current cursor state, on or off. If the cursor is currently
shown on the screen, regardless of shape, a logical true (.T.) will
be returned, otherwise a logical false (.F.) will be.
Format:
cursor(['std' | 'off' | 'half' | 'full'] | [start,end])
Parameters:
'std'.....Character string variable or constant, non case
sensitive, instructing the function to set the
cursor to the default for the current monitor type.
'off'.....Character string variable or constant, non case
sensitive, instructing the function to set the
cursor off. The cursor will not show on the current
monitor.
Page #9
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
CURSOR (cont'd)
'half'....Character string variable or constant, non case
sensitive, instructing the function to set the
cursor to one half of the total character size for
the current monitor type.
'full'....Character string variable or constant, non case
sensitive, instructing the function to set the
cursor to cover the total character position for the
current monitor type.
start.....Numeric variable or constant which will be used by
the function as the starting scan line. Validity
determination is left up to the application program
in order to provide full flexibility. Specifying
START assumes an END will be specified and is
mutually exclusive from the pre-programmed parameter
types.
end.......Numeric variable or constant which will be used by
the function as the ending scan line. Validity
determination is left up to the application program
in order to provide full flexibility. Specifying
END assumes a START was specified and is mutually
exclusive from the pre-programmed parameter types.
()........If no parameters are given to the function, it will
return indicating whether the cursor is currently
displayed or not.
Examples:
1. Set the cursor to one half of the current size and then
turn it off for some other activity.
.
.
.
cursor('half')
.
.
.
cursor('off')
.
.
.
Page #10
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
CURSOR (cont'd)
2. Change the cursor to a special shape.
.
.
.
cursor(2,7)
.
.
.
3. Determine if the cursor is currently displayed and turn
it off if it is.
.
.
.
if cursor()
cursor('off')
endif
.
.
.
Returns:
.T. .....If no parameters were specified a return of a
logical true indicates that the cursor is currently
shown on the display.
.F. .....If no parameters were specified a return of a
logical false indicates that the cursor is not
currently shown on the display.
Cautions:
None.
Page #11
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ERASTEXT
--------
If you've ever constructed a screen using the Clipper BOX command
you know that it can be difficult to remember where the box border
stops and your text begins, especially if you only want to erase a
few lines of the text. Generating FOR...NEXT loops to erase only
that portion of an enclosed area is no fun. Enter ERASTEXT, which
will erase all standard ASCII characters (text & numbers) from
within the requested area. Simply specify the coordinates and
"zap" all the text is gone. Does not affect the attribute in use
at the time.
Format:
erastext(top,left,bottom,right [,type])
Parameters:
top.......Numeric variable or constant indicating the top row
of the area to be changed. Value checked to be
between 0 and 24 inclusive.
left......Numeric variable or constant indicating the left
column of the area to be changed. Value checked to
be between 0 and 79 inclusive.
bottom....Numeric variable or constant indicating the ending
row of the area to be changed. Value checked to be
greater than TOP but less than or equal to 24.
right.....Numeric variable or constant indicating the right
column of the area to be changed. Value checked to
be greater than LEFT but less than or equal to 79.
type......OPTIONAL. Logical variable or constant instructing
the function to use DMA updating or not.
.T. DEFAULT. If not specified, the
function will use DMA screen
updating.
.F. Setting this flag to a logical false
will cause the function to use the
standard BIOS INT 10H for screen
updating.
Page #12
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ERASTEXT (cont'd)
Examples:
1. Erase a video line without affecting the BOX borders
around the line.
.
.
.
@ 08,20,16,60 box '(special characters)'
@ 09,21 say (something useful)
@ 10,21 say (something useful)
@ 11,21 say (something useful)
@ 12,21 say (something useful)
@ 13,21 say (something useful)
.
.
.
erastext(11,20,13,60)
.
.
.
Returns:
Nothing.
Cautions:
None.
Page #13
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
FILEATTR
--------
If you have clients who like to tinker too much, this function can
be invaluable. Employing this function properly it is now
extremely easy to "lock" a file where the average user cannot
inadvertently damage it.
The FILEATTR function allows setting or resetting the directory
attributes of a given file. Attributes available are read-only,
archive, hidden and system. Prudent use of the read-only and/or
hidden attribute can protect your databases from prying eyes. To
reaccess the database simply have your application remove the
necessary flags prior to use, it's that easy.
Format:
fileattr(filename,fileattr)
Parameters:
filename..Character string variable or constant, non case
sensitive, which contains the filename whose
attributes you wish to change. The filename should
follow the standard [drive:][\path\]filename format
where drive and path are optional. Wildcards (* &
?) are not allowed in the filename.
fileattr..Character string variable or constant, non case
sensitive, which provides the function with a list
of all attributes to set or reset.
+ (plus sign) An attribute proceeded by a plus sign
(+) instructs the function to set
this flag in the directory entry for
this file.
- (minus sign) An attribute proceeded by a minus
sign (-) instructs the function to
clear this flag in the directory
entry for this file.
Page #14
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
FILEATTR (cont'd)
NOTE: Although not advisable, it is
possible to place an activate (+) and
deactivate (-) for the same flag in
the attribute string (eg. '+r/o -arc
-r/o'). The last flag encountered in
a left to right scan will be the
action taken. In this example the
file would have the read-only and
archive cleared (not set), the '+r/o'
would have no effect.
(valid file attributes)
r/o Read only
hid Hidden
sys System
arc Archive
Examples:
1. Suppose you have "dangerous" clients who are constantly
fiddling with your files and inadvertently deleting them
from time to time. In order to prevent this your
application could set the "read-only" attribute prior to
terminating. To access the files again the application
could reset the "read-only" attribute when starting up.
(program start)
.
.
fileattr('CLIENT.DBF','-r/o')
.
(program executes)
.
fileattr('CLIENT.DBF','+r/o')
.
.
(program ends)
Page #15
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
FILEATTR (cont'd)
1. Combined with the DIR function, do the above example
through all existing files in the subdirectory.
(program starts)
.
.
filename = DIR('*.*','first')
do while .not. empty(filename)
fileattr(filename,'-r/o')
filename = DIR('next')
enddo
.
(program executes)
.
filename = DIR('*.*','first')
do while .not. empty(filename)
fileattr(filename,'+r/o')
filename = DIR('next')
enddo
.
(program ends)
Returns:
.T. .....Logical true (.T.) to indicate success of function.
Setting or resetting attributes which have already
been set or reset will still return a success flag.
.F. .....Logical false (.F.) to indicate failure of the
function.
Cautions:
In order to assume proper operation, all files should be
closed which may be accessed by the function.
Page #16
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
GETCOLOR
--------
GETCOLOR goes to the screen location specified in the parameters
and obtains the current color attribute. This attribute is then
returned to your program in the form of a standard Clipper
character string compatible with the SET COLOR TO format (eg.
'+gr/b'). The function may optionally "flip" the color attribute
in that the returned string will be the exact inverse of what is
actually there (eg. '+b/gr').
Format:
<memvar> = getcolor(row, col [,flip])
Parameters:
row.......Numeric variable or constant which, when combined
with COL, informs the function of the screen
location from which to obtain the current color.
col.......Numeric variable or constant which, when combined
with ROW, informs the function of the screen
location from which to obtain the current color.
flip......OPTIONAL. Logical variable or constant which
instructs the function as to whether to invert the
color attribute before returning it
.T. Force the attribute to invert (flip)
itself. For example, a color of
'+w/b' would be flipped to be '+b/w'.
.F. DEFAULT. Do not flip the color
attribute, return it as it actually
is.
Page #17
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
GETCOLOR (cont'd)
Examples:
1. After your application program loads you wish to obtain
the current screen color so it may be restored before
your application completes. (The color of the screen
BEFORE your program invoked it's colors was bright yellow
text on a blue background)
doscolor = getcolor(0,0)
* now doscolor = '+gr/b'
.
.
set color to &mycolors
clear
.
.
(application program)
.
.
set color to &doscolor
quit
Returns:
memvar....A character string variable which will contain a
text description of the current color at the
position selected. If nothing is returned an error
was detected in your screen coordinates. The valid
range is (0,0) thru (24,79).
(Possible Return Color Values)
black n
blue b
green g
cyan bg
red r
magenta rb
brown gr
white w
intense +
blink *
Cautions:
None.
Page #18
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ISCGA
-----
Determines if the current screen is driven by a Color Graphics
Adapter (CGA). Adapters which are supersets of the CGA standard
should be tested for EGA or VGA compatibility first. An EGA or VGA
emulating a CGA will not return indicating a CGA is attached.
Returns a logical true (.T.) or false (.F.) indicator.
Format:
iscga()
Parameters:
None.
Examples:
1. Determine if the current monitor is standard CGA.
.
.
.
if iscga()
(do color stuff)
endif
.
.
.
Returns:
.T. .....Indicates that the current screen is a CGA type.
.F. .....Indicates that the current screen is not a CGA type.
Cautions:
None.
Page #19
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ISEGA
-----
Determines if the current screen is driven by an Enhanced Color
Graphics Adapter (EGA). Adapters which are supersets of the EGA
standard should be tested for VGA compatibility first. A VGA
emulating an EGA will not return indicating an EGA is attached.
Returns a logical true (.T.) or false (.F.) indicator.
Format:
isega()
Parameters:
None.
Examples:
1. Determine if the current monitor is an EGA.
.
.
.
if isega()
(do fancy stuff)
endif
.
.
.
Returns:
.T. .....Indicates that the current screen is an EGA type.
.F. .....Indicates that the current screen is not an EGA
type.
Cautions:
None.
Page #20
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ISMONO
------
Determines if the current screen is a monochrome or fully
monochrome compatible monitor. A VGA emulating a monochrome
monitor will not return indicating a monochrome is attached.
Returns a logical true (.T.) or false (.F.) indicator.
Format:
ismono()
Parameters:
None.
Examples:
1. Determine if the current monitor is monochrome.
.
.
.
if ismono()
(do monochrome stuff)
endif
.
.
.
Returns:
.T. .....Indicates that the current screen is a monochrome
type.
.F. .....Indicates that the current screen is not a
monochrome type.
Cautions:
None.
Page #21
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
ISVGA
-----
Determines if the current screen is driven by a Video Graphics
Array Adapter (VGA) or 100% compatible. Returns a logical true
(.T.) or false (.F.) indicator.
Format:
isvga()
Parameters:
None.
Examples:
1. Determine if the current monitor is a VGA.
.
.
.
if isvga()
(do real pretty and fancy stuff)
endif
.
.
.
Returns:
.T. .....Indicates that the current screen is a VGA type.
.F. .....Indicates that the current screen is not a VGA type.
Cautions:
None.
Page #22
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
NEWCOLOR
--------
Changing colors on entire areas of the screen, regardless of the
current screen contents, can now be managed very effectively and
efficiently with NEWCOLOR.
The NEWCOLOR function provides the programmer with the ability to
change colors on the screen without having to reset the color and
rewrite the screen information. This is particularly useful in
those occasions when a highlighting of information is necessary
which would normally be prohibitive due to slow screen update
characteristics. Self programmed light bar menus and highlighting
screen selections becomes much easier with this function employed.
Format:
newcolor(top, left, bottom, right, attr [,type])
Parameters:
top.......Numeric variable or constant indicating the top row
of the area to be changed. Value checked to be
between 0 and 24 inclusive.
left......Numeric variable or constant indicating the left
column of the area to be changed. Value checked to
be between 0 and 79 inclusive.
bottom....Numeric variable or constant indicating the ending
row of the area to be changed. Value checked to be
greater than TOP but less than or equal to 24.
right.....Numeric variable or constant indicating the right
column of the area to be changed. Value checked to
be greater than LEFT but less than or equal to 79.
attr......Character string variable or constant, non case
sensitive, valid color command or combination for
character and background. Must be the alpha
representation of the color, the numeric will be
rejected.
Page #23
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
NEWCOLOR (cont'd)
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
intense +
blink *
type......OPTIONAL. Logical variable or constant instructing
the function to use DMA updating or not.
.T. DEFAULT. If not specified, the
function will use DMA screen
updating.
.F. Setting this flag to a logical false
will cause the function to use the
standard BIOS INT 10H for screen
updating.
Examples:
1. This will change the character attributes from row #10,
column #20 through row #12, column #60 to intense
blinking red (*+r) on a black background (n).
.
.
.
newcolor(10,20,12,60,'*+r/n)
.
.
.
Page #24
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
NEWCOLOR (cont'd)
2. This will change the character attributes from row #05,
column #10 through row #05, column #15 to inverse white
(w) with black characters (n).
.
.
.
newcolor(5,10,5,15,'n/w')
.
.
.
Returns:
Nothing.
Cautions:
None.
Page #25
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
PRTSC
-----
Many times users of your applications have simply wanted a print
screen of what they see. In order to accommodate them you usually
need to write a routine will recreates the information on the
printer. With PRTSC this is no longer necessary.
The PRTSC function actually contains two separate functions. The
first function is a command driven print screen. Embedded in your
source code, the PRTSC command will cause a print screen to happen
just as if the SHIFT PRTSC keys were pressed.
The second function of PRTSC is that of a translator. With the use
of the BOX command many screens have become "unprintable" by usual
standards. Doing a print screen causes strange characters or
control codes to be sent to the printer. The PRTSC function has
the ability to intercept those "unprintable" characters and
translate them into simple, unoffensive periods (.). The basic
design of your screen is intact but without lots of programming
effort.
Format:
prtsc(['xlat' | 'off'])
Parameters:
()........If no parameters are specified, instructs the
function to perform an immediate print screen. If
the translate facility has been activated then the
function will perform the print screen translation,
otherwise the standard BIOS interrupt perform as
usual.
'xlat'....Character string variable or constant, non case
sensitive, which instructs the function to begin
translation of all print screen activity. If a
print screen is invoked, either from PRTSC() or from
the keyboard, all characters will be translated
which do not fall into the following range: ASCII 32
to 127 (" " to "~"). The characters are translated
into a period (.).
Page #26
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
PRTSC (cont'd)
'off'.....Character string variable or constant, non case
sensitive, which instructs the function to terminate
translation of all print screen activity. Control
is returned to the BIOS for print screen requests.
Examples:
1. A user wishes a snapshot of the currently displayed
record. Rather than writing a report routine, a print
screen is invoked but, as the screen contains graphical
box characters, a translation is first required.
.
.
.
prtsc('xlat')
prtsc()
prtsc('off')
.
.
.
2. Thinking ahead, the programmer has determined during
installation that the user's printer cannot print the
graphical box characters used on the display screen. The
translate facility has been activated and when the user
performs a manual print screen the translation is still
effective.
.
.
prtsc('xlat')
.
.
(user presses Shift PrtSc)
.
.
prtsc('off')
(end of program)
Page #27
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
PRTSC (cont'd)
Returns:
Nothing.
Cautions:
This function should not be placed into an overlay as it is
interrupt driven. Any error routines which determine an
unrecoverable runtime error has occurred should disable this
function prior to exiting the program. Failure to follow this
caution may result in the computer locking up.
Page #28
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
RESET
-----
The ultimate in password protection, and possibly frustrating
enough to prevent future attempts is a complete reset of the
computer. The RESET function provides an instantaneous reset of
the computer. The reset may either be a software reset or a full
hardware reset.
Format:
reset([.T. | .F.])
Parameters:
.T. .....Logical variable or constant which instructs the
function to perform a full hardware reset of the
computer. A hardware reset is defined as a reset
which causes all hardware interrupts to be halted
and restarted by the regular BIOS routines.
Hardware reset may not prove functional on non-100%
compatible BIOS computers. Hardware reset invokes
all BIOS manufacturer tests (i.e. RAM test).
.F. .....DEFAULT. Logical variable or constant which
instructs the function to perform a standard
software reset. This reset is similar in nature to
the CTRL ALT DEL key sequence. If no parameter is
given to RESET then .F. is assumed.
Examples:
1. Perform a hardware reset of the computer.
.
.
.
reset(.t.)
.
.
.
Page #29
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
RESET (cont'd)
2. Perform a software reset of the computer.
.
.
.
reset()
.
.
.
Returns:
Nothing.
Cautions:
This function will immediately halt all operation in the
computer. Due to this it is strongly suggested that no files
or background operations (print queues) be active when RESET
is invoked.
Page #30
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
RESTBOX
-------
Possibly one of the most flexible functions in PROCLIP2, the
RESTBOX function is the companion to SAVEBOX. Once a section of
the screen has been placed into a memory variable by SAVEBOX, the
RESTBOX function may be used to restore it.
RESTBOX "knows" where the screen portion originally came from, so
remembering the coordinates is no longer a necessity. It is
possible, however, to override those original coordinates and
reposition the screen portion anywhere on the screen. You may also
use either the original colors, as it was saved, or override them
with a new color attribute.
Through creative use of SAVEBOX, RESTBOX and the standard Clipper
BOX command an impressive control of the screen may be obtained.
RESTBOX is not compatible with memory variables saved by the
Clipper SAVESCREEN function.
Format:
restbox([top, left,] scrnarea [,attr][,type])
Parameters:
top.......OPTIONAL. Numeric variable or constant indicating
the top row of where the SAVEBOX'd area is to be
restored. Value checked to be between 0 and 24
inclusive. If TOP is specified then LEFT must also
be specified. If TOP,LEFT is not specified RESTBOX
will obtain the original position from within the
SAVEBOX'd variable.
left......OPTIONAL. Numeric variable or constant indicating
the left column of where the SAVEBOX'd area is to be
restored. Value checked to be between 0 and 79
inclusive. If LEFT is specified then TOP must also
be specified.
scrnarea..Character string variable containing a saved portion
of the screen which was saved with SAVEBOX. No
changes to this memory variable should have occurred
between the SAVEBOX command and RESTBOX. Cannot be
a memory variable saved by the Clipper SAVESCREEN
function.
Page #31
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
RESTBOX (cont'd)
attr......OPTIONAL. Character string variable or constant,
non case sensitive, which contains a valid color
combination for character and background. This
color attribute will be used during the restore to
the screen but the original image as saved by
SAVEBOX will not be modified. Must be the alpha
representation of the color, the numeric will be
rejected.
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
intense +
blink *
type......OPTIONAL. Logical variable or constant instructing
the function to use DMA updating or not. As this is
an optional parameter the function will assume you
wish IBM standard BIOS INT 10H updating.
.T. DEFAULT. If not specified, the
function will use DMA screen
updating.
.F. Setting this flag to a logical false
will cause the function to use the
standard BIOS INT 10H for screen
updating.
Examples:
1. This will restore a previously saved screen area to the
original location but use a different color attribute.
.
.
.
restbox(scrn1,'+r/n')
.
.
.
Page #32
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
RESTBOX (cont'd)
2. This will restore a previously saved screen area to row
#10, column #20 even if this is a different location than
it was originally obtained from.
.
.
.
restbox(10,20,scrn1)
.
.
.
3. A typical SAVEBOX and RESTBOX combination.
.
.
.
scrn1 = savebox(10,20,12,60)
.
.
.
restbox(scrn1)
.
.
.
Returns:
Nothing.
Cautions:
None.
Page #33
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
RESTCURS
--------
The companion function to SAVECURS, the RESTCURS function will
restore the cursor to it's original shape and position as specified
in the memory variable. Great for restoring the look of a given
screen without having to remember where everything was.
Format:
restcurs(<memvar>)
Parameters:
<memvar>..A numeric memory variable which was created through
SAVECURS and contains the cursor shape and position
to restore.
Examples:
See SAVECURS.
Returns:
Nothing.
Cautions:
See SAVECURS.
Page #34
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SAVEBOX
-------
The SAVEBOX function provides the programmer with a method of
saving partial screen images into character memory variables and,
using the RESTBOX function, restore them back when needed.
SAVEBOX will allow the programmer to save any area of the screen
which contains at least one (1) character and up to the entire
screen (4000 bytes). This allows multiple "snapshots" of various
area of the screen using the minimum amount of memory necessary.
As a temporary storage buffer is required for the screen area
during the snapshot, this function temporarily allocates memory
from DOS. If insufficient memory is available the function will
refuse to perform and none of the screen area will be saved. It is
very unlikely that this could happen as even the entire screen
requires less than 4Kb for temporary storage.
Format:
<memvar> = savebox(top, left, bottom, right [,type])
Parameters:
top.......Numeric variable or constant indicating the top row
of the area to be saved. Value checked to be
between 0 and 24 inclusive.
left......Numeric variable or constant indicating the left
column of the area to be saved. Value checked to be
between 0 and 79 inclusive.
bottom....Numeric variable or constant indicating the ending
row of the area to be saved. Value checked to be
greater than TOP but less than or equal to 24.
right.....Numeric variable or constant indicating the right
column of the area to be changed. Value checked to
be greater than LEFT but less than or equal to 79.
Page #35
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SAVEBOX (cont'd)
type......OPTIONAL. Logical variable or constant instructing
the function to use DMA updating or not.
.T. DEFAULT. If not specified, the
function will use DMA screen
updating.
.F. Setting this flag to a logical false
will cause the function to use the
standard BIOS INT 10H for screen
updating.
Examples:
1. To save the screen data, and attributes, into a memory
variable from row #10, column #20 through row #12, column
#60.
.
.
.
scrnarea = savebox(10,20,12,60)
.
.
.
Returns:
<memvar>..A character string variable which contains the data
as it was read from the screen preceded by four (4)
bytes of control information.
Cautions:
Do not modify the contents of the memory variable after it is
returned from SAVEBOX. The results may not be as you desire.
Page #36
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SAVECURS
--------
SAVECURS provides the programmer with the ability to save the
current cursor shape and position on the video screen. This is
extremely useful when using any type of on-line help system or
other functions which temporarily occupy the screen and you'd like
the cursor to return where it was when completed. See RESTCURS.
Format:
<memvar> = savecurs()
Parameters:
None.
Examples:
1. Save the current cursor shape and position while invoking
a subfunction.
.
.
.
aCursor = savecurs()
.
(do a sub function)
.
restcurs(aCursor)
.
.
.
Page #37
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SAVECURS (cont'd)
Returns:
<memvar>..a numeric variable which will contain the cursor
shape and position on the screen. These values are
embedded in this variable and the variable will
return a zero (0) value if accessed from Clipper.
Cautions:
In order to properly restore the cursor care should be taken
not to use the numeric variable in any other fashion.
Page #38
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SDIR
----
Similar to the standard Clipper ADIR command, the SDIR command
provides the programmer with the ability to read any valid
directory and obtain standard directory information on an entry by
entry basis. Entries include all valid directory entries including
subdirectory and volume label names. Using the attribute filter,
the SDIR function will only return those files matching the
attributes. SDIR will return the entry name, date, time or file
size depending upon the function call used.
Format:
<memvar> = SDIR(pattern, 'first' [,fileattr])
<memvar> = SDIR('next')
<memvar> = SDIR('date')
<memvar> = SDIR('time')
<memvar> = SDIR('size')
<memvar> = SDIR(pattern, 'count' [,fileattr])
Parameters:
pattern...Character string variable or constant, non case
sensitive, which informs the function of the entry
pattern to search with. The PATTERN may contain any
valid drive or DOS path as well as wildcards (eg.
"*" & "?").
'first'...Character string variable or constant, non case
sensitive, which instructs the function to obtain
the first matching directory entry in the specified
directory. If FIRST is specified then a PATTERN
must be supplied. FIRST reinitializes the search
function and sets up the function for subsequent
activity based on the PATTERN provided.
Page #39
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SDIR (cont'd)
'next'....Character string variable or constant, non case
sensitive, which instructs the function to obtain
the next matching entry based on the last FIRST
function. In other words, a FIRST must be called
first in order to obtain the first entry and
initialize the function. Subsequent NEXT functions
will continue reading the directory one entry at a
time until all entries have been read.
'date'....Character string variable or constant, non case
sensitive, which instructs the function to obtain
the date of the last entry returned with either
FIRST or NEXT, whichever was last. If the file is
currently open (as in an active database file) this
date may not reflect the actual last update date.
In these cases the active file should be closed to
allow the operating system to update the directory
prior to requesting this function.
'time'....Character string variable or constant, non case
sensitive, which instructs the function to obtain
the time of the last entry returned with either
FIRST or NEXT, whichever was last. As in DATE the
file should be closed prior to requesting this
function.
'size'....Character string variable or constant, non case
sensitive, which instructs the function to obtain
the size of the last entry returned with either
FIRST or NEXT, whichever was last. As in TIME and
DATE above the file should be closed prior to
requesting this function.
'count'...Character string variable or constant, non case
sensitive, which instructs the function to obtain
the number of files matching PATTERN. If COUNT is
specified then PATTERN must also be specified.
Page #40
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SDIR (cont'd)
fileattr..Character string variable or constant, non case
sensitive, which instructs the function to only
select those directory entries which have at least
these attributes.
(valid file attributes)
r/o Read only
hid Hidden
sys System
vol Volume label
sub Subdirectory
arc Archive
Examples:
1. Read the current directory and when the chosen file is
found obtain the date, time and size of the file. As no
attribute is specified all directory entries will be
returned which match the pattern and have at least the
archive attribute set (arc).
.
.
.
pattern = 'YOUR????.DBF'
filename = sdir(pattern,'first')
if .not. empty(filename)
filedate = sdir('date')
filetime = sdir('time')
filesize = sdir('size')
endif
.
.
.
Page #41
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SDIR (cont'd)
1. Read a different, valid, directory and return all of the
names of all subdirectory entries by specifying an
attribute of subdirectory only.
.
.
.
aSubDir = sdir('C:\LEVEL1\LEVEL2\*.*','first','sub')
do while .not. empty(aSubDir)
? direntry
aSubDir = sdir('next')
enddo
.
.
.
Returns:
'first'...If successful, <memvar> is set to a character string
type and returned with the filename of the first
file matching PATTERN. If unsuccessful, <memvar> is
set to a character string type and returned with a
zero length (null).
'next'....Same as FIRST.
'date'....If successful, <memvar> is set to a date type and
returned with the entry date per the active
directory entry. If unsuccessful, <memvar> is set
to a date type and returned with a '00/00/00' date.
'time'....If successful, <memvar> is set to a character type
and returned with the entry time per the active
directory entry in HH:MM:SS format. If
unsuccessful, <memvar> is set to a character type
and returned with a zero length (null).
'size'....If successful, <memvar> is set to a numeric type and
returned with the file size (subdirectory entries
are always zero (0) length) per the active directory
entry. If unsuccessful, <memvar> is set to a
numeric type and returned with a zero value (0).
Page #42
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SDIR (cont'd)
'count'...If successful, <memvar> is set to a numeric type and
returned with the number of entries matching the
specified pattern. If unsuccessful, <memvar> is set
to a numeric type and returned with a zero value
(0).
Cautions:
None.
Page #43
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SOUND
-----
Similar in general concept to the Clipper TONE() command, SOUND()
provides the programmer with the added flexibility of creating
sounds for a shorter duration of time. The Clipper TONE() command
is driven off the internal timer of the computer which "pulses"
18.2 times per second. Due to this the TONE() command has a
"resolution" of 1/18th of a second in that it cannot generate a
tone for a shorter duration of time. With SOUND() it is possible
to create a sound for as little as 1/100th of a second. Although
1/100th of a second is the same from computer to computer, software
can have difficultly calculating what 1/100th of a second is due to
timing differences between computers. SOUND() does not have this
problem as it automatically calculates the exact timing necessary
for 1/100th of a second to pass, regardless of CPU speed.
Format:
sound(tone, duration [,type])
Parameters:
tone......Numeric variable or constant which informs the
function of the frequency you wish to use. The
frequency is the number of Hertz (cycles per
second). The higher the frequency the higher the
tone, the lower the frequency the lower the tone.
Allowable range for this parameter is 37 through
32767.
duration..Numeric variable or constant which informs the
function of the duration to use. The duration is
the amount of time the speaker will generate the
tone before shutting off. As two duration
resolutions are available (timer and internal), this
value will have different meanings. See the "type"
description below.
Page #44
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SOUND (cont'd)
type......OPTIONAL. Logical variable or constant which
informs the function as to the type of duration to
use.
.T. DEFAULT. Instructs the function to
use timer ticks as the duration
count. A duration of 5 would last
for 5 timer ticks or 5/18ths of a
second. Resolution range in this
mode is 1/18th of a second to 3,640
seconds (approx 1 hour).
.F. Instructs the function to use
1/100ths as the duration count. A
duration of 5 would last for 5/100ths
(1/20th) of a second. Resolution
range in this mode is 1/100th of a
second to 655 seconds (10.9 minutes).
Examples:
1. Generate a good tone for an error message. Use the
"internal timing" of 1/100ths of a second. Each tone
will be generated for 3/100ths of a second.
.
.
.
sound(2000,3,.F.)
sound(500,3,.F.)
sound(2000,3,.F.)
.
.
.
2. Generate a tone indicating a different condition than
above. Use the default timing of "timer ticks". Each
sound will be generated for 1/18th of a second.
.
.
.
sound(2000,1)
sound(1000,1)
.
.
.
Page #45
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SOUND (cont'd)
Returns:
Nothing.
Cautions:
None.
Page #46
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SPRINT
------
Add new flexibility to your programming with the SPRINT command.
This function allows display of a character string on the screen
using a different color attribute than that which is currently
selected through SET COLOR TO. The function will either retain the
current cursor position or move the cursor to the end of the newly
displayed string. Not subject to SET DEVICE TO so updating of
screen and printer can be performed easily.
Format:
sprint([row, col,] string [,attr][,type])
or
@ x,y say sprint(string [,attr][,type])
Parameters:
row.......OPTIONAL. Numeric variable or constant which
informs the function of the row (line) number on
which to begin display of the string. Use of ROW
assumes a COL will be specified. ROW must be a
valid video line number between 0 and 24 inclusive.
If the string will not fit on ROW it will be wrapped
to the following line (if any).
col.......OPTIONAL. Numeric variable or constant which
informs the function of the column number on which
to begin the display of the string. Use of COL
assumes the use of ROW. COL must be a valid video
column number between 0 and 79 inclusive. Using the
format of sprint(row,col...) will not reposition the
cursor, the cursor position will not change. Using
the @ x,y say... format will reposition the cursor
to the end of the displayed string.
sprint(row,col...)
After printing the string, the cursor
will be returned to the position last
known by Clipper. In other words the
cursor will not move.
Page #47
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SPRINT (cont'd)
@...SAY sprint(...)
After printing the string, the cursor
will be moved to the end of the
string just printed. Acts similar to
the standard @...SAY... in this
fashion but you still get the color
override capability.
string....Character string variable or constant which will be
displayed beginning at the requested position.
attr......OPTIONAL. Character string variable or constant,
non case sensitive, which informs the function what
color attributes to use when displaying. If not
specified the function will use the attribute
currently displayed on the screen at the starting
position for the string.
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
intense +
blink *
type......OPTIONAL. Logical variable or constant instructing
the function to use DMA updating or not.
.T. DEFAULT. If not specified, the
function will use DMA screen
updating.
.F. Setting this flag to a logical false
will cause the function to use the
standard BIOS INT 10H for screen
updating.
Page #48
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
SPRINT (cont'd)
Examples:
1. Print a warning message on the screen but do not
reposition the cursor. Further, print the message in
bright red on a black background even though those colors
are not currently selected.
.
.
.
sprint(24,00,"Don't press that key again!","+r/b")
.
.
.
2. Print a message on the screen and reposition the cursor
to the end of the message. Use the intense white on a
black background.
.
.
.
@ 10,00 say sprint('Enter your password: ','+w/b')
.
.
.
Returns:
null......A null character string is returned thereby allowing
SPRINT to be used "in line" with a standard Clipper
@... SAY... (eg. @ X,Y SAY "Hi" + sprint(...) is
valid).
Cautions:
None.
Page #49
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
STAMP
-----
Many times date and time stamps are the only way to know when a
database was last used. The STAMP functions provides the
programmer with the ability to change the date and/or time of any
file. If no date and time are given in the function call, the
STAMP function will set the date and time of the file to the
current date and time as maintained by DOS.
Format:
stamp(filename [,date] [,time])
Parameters:
filename..Character string variable or constant, non case
sensitive, which contains the filename to STAMP.
STAMP will not accept filenames containing wildcards
(* & ?) but paths and alternate drives are
acceptable.
date......Date variable or constant which is the date to set
the file to. If DATE is not specified, and TIME is
specified, the file's date stamp will not be
affected.
time......Character string variable or constant containing the
time to set the file to. The time format should be
HH:MM:SS but seconds are not necessary (eg. HH:MM is
also valid). If TIME is not specified, and DATE is
specified, the file's time stamp will not be
affected.
If no parameters are specified other than the
FILENAME, the date and time will be obtained from
DOS and the file's date and time stamps will be
updated accordingly.
Page #50
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
STAMP (cont'd)
Examples:
1. Set all of the DBF files in the directory to a specific
date and time.
.
.
.
aDate = ctod("10/22/86")
aTime = "10:12:15"
filename = sdir("*.*","first")
do while .not. empty(filename)
stamp(filename,aDate,aTime)
filename = sdir('next')
enddo
.
.
.
Returns:
Nothing.
Cautions:
The file being STAMPed should not currently be opened by any
other process. Close all files first.
Page #51
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
UNRESET
-------
Having frustrated users reset the computer in the middle of your
application is not fun...neither is recovering corrupted data
bases. UNRESET is designed to intercept the CTRL ALT DEL keyboard
sequence and, optionally, prevent the computer from resetting.
UNRESET will, at the programmers option, either intercept and
ignore CTRL ALT DEL keyboard sequences or intercept and display a
warning message to the operator which requires a second CTRL ALT
DEL to activate the reset.
Format:
unreset('on' | 'off' | 'warn')
Parameters:
'on'......Character string variable or constant, non case
sensitive, which instructs the function to become
active and intercept and ignore all CTRL ALT DEL
keyboard sequences.
'off'.....Character string variable or constant, non case
sensitive, which instructs the function to disable
itself and allow CTRL ALT DEL keyboard sequences
through to the regular computer keyboard routines.
'warn'....Character string variable or constant, non case
sensitive, which instructs the function to become
active and intercept all CTRL ALT DEL keyboard
sequences. Once intercepted the function will warn
the user of their action by opening a window
centered on the screen which reads:
CTRL + ALT + DEL
Press again to confirm
The user must then reissue the CTRL ALT DEL sequence
to force a reset or, by pressing any regular key,
close the window and resume execution of the
program.
Page #52
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
UNRESET (cont'd)
Examples:
1. Completely disable CTRL ALT DEL during critical
processing.
.
.
.
unreset('on')
use dbffile index ntxfile
append blank
replace ...
close databases
unreset('off')
.
.
.
2. Issue a warning prior to allowing a reset to occur.
Disable the UNRESET function before exiting program.
.
.
.
unreset('warn')
.
.
.
unreset('off')
quit
Returns:
Nothing.
Cautions:
This function should not be placed into an overlay as it is
interrupt driven. Any error routines which determine an
unrecoverable runtime error has occurred should disable this
function prior to exiting the program. Failure to follow this
caution may result in the computer locking up.
Page #53
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
VIDEO
-----
The VIDEO function has the ability to disable or enable the video
signal to the current video controller. This has the effect of
"blanking" a monitor during idle times which will prevent monitor
burn. Current supported monitor types are monochrome (MONO), color
(CGA), enhanced (EGA) and video graphics array (VGA).
Format:
video('on' | 'off')
Parameters:
'on'......Character string variable or constant, non case
sensitive, instructing the function to enable the
video signal on the video controller. Uses the last
BIOS saved screen mode to enable the video signal
through a direct command to the video controller.
The screen will restore to the current contents of
the video memory instantaneously.
'off'.....Character string variable or constant, non case
sensitive, instructing the function to disable the
video signal on the video controller. Uses the last
BIOS saved screen mode, modified with proper bit
settings, to disable the video signal through a
direct command to the video controller. None of the
information is lost from the screen as the screen is
simply "turned off", not erased.
Examples:
1. Turn off the video controller video drive signal after
waiting sixty (60) seconds for some keystroke.
.
.
.
inkey(60)
video('off')
.
.
.
Page #54
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
VIDEO (cont'd)
2. Turn on the video controller drive signal.
.
.
.
video('on')
.
.
.
Returns:
Nothing.
Cautions:
None.
Page #55
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
VSCROLL
-------
The premier scrolling function...bar none. Many times we've all
needed a scrolling function like VSCROLL. The VSCROLL function
performs video scrolling, either vertically (up and down) or
horizontally (left and right), and allows the programmer to control
the attribute of the blank line (or column) left behind by the
scrolling action.
Format:
vscroll(top, left, bottom, right, lines, dir [,attr])
Parameters:
top.......Numeric variable or constant indicating the top row
of the area to be scrolled. Value checked to be
between 0 and 24 inclusive.
left......Numeric variable or constant indicating the left
column of the area to be scrolled. Value checked to
be between 0 and 79 inclusive.
bottom....Numeric variable or constant indicating the ending
row of the area to be scrolled. Value checked to be
greater than TOP but less than or equal to 24.
right.....Numeric variable or constant indicating the right
column of the area to be scrolled. Value checked to
be greater than LEFT but less than or equal to 79.
lines.....Numeric variable or constant indicating the number
of lines or columns to be scrolled, or zero (0) to
scroll entire window (effectively erasing it).
Value checked to be equal to or less than BOTTOM -
TOP if a vertical scroll or equal to or less than
RIGHT - LEFT if horizontal. If greater than the
number of available lines or columns within the
specified area zero (0) will be assumed.
dir.......Character string variable or constant, non case
sensitive, indicating the direction of the scroll
('u' = Up, 'd' = Down, 'l' = Left, 'r' = Right).
Page #56
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
VSCROLL (cont'd)
attr......OPTIONAL. Character string variable or constant,
non case sensitive, containing a valid color command
or combination for character and background. Must
be the alpha representation of the color, the
numeric will be rejected. The default is the color
attribute currently on the screen for the character
in the TOP, LEFT position.
(valid colors)
black N
blue B
green G
cyan BG
red R
magenta RB
brown GR
white W
intense +
blink *
Examples:
1. This will scroll one line down in the area from row #10,
column #20 through row #12, column #60 using an attribute
of black character (n) and white background (w).
.
.
.
vscroll(10,20,12,60,1,'d','n/w')
.
.
.
2. This will scroll one column to the right in the area from
row #05,column #00 through row #20, column #79 using
whatever the attribute of the character at 10,20
currently is.
.
.
.
vscroll(05,00,20,79,1,'r')
.
.
.
Page #57
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
VSCROLL (cont'd)
Returns:
Nothing.
Cautions:
None.
Page #58
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDAT
------
The WILDAT function will perform a search of a target string for
the first occurrence matching the specified string pattern. The
pattern string may contain the wildcard character (?) indicating a
"don't care" for this position within the match. The function also
has the options of ignoring case during the match or altering the
offset within the target string for the scan to begin.
Format:
wildat(pattern, target [,offset] [,case])
Parameters:
pattern...Character string variable or constant which is the
string to look for in the TARGET string. The
PATTERN length must be greater than zero, less than
32,767 and shorter than the TARGET length. The
following are special cases within the pattern.
? (wildcard) Indicates to the matching process
that it should ignore the character
in this position, but that a
character will exist in that
position. The PATTERN of "t??" will
match on all of the following
examples: "that", "test", "text" and
"with this". The last one will match
because of the .."th t.." matches the
wildcard pattern.
\ (literal) Indicates to the matching process
that it should take the next
character in the PATTERN literally.
This may be used when attempting to
match on the wildcard character
itself. For instance, a pattern of
"\?" will match in the phrase "Do you
understand?" when the question mark
is encountered. To match on the
backslash character (\) itself, just
precede it with a literal flag (eg.
"\\").
Page #59
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDAT (cont'd)
target....Character string variable or constant which is the
string to search for the occurrence of PATTERN. The
TARGET length must be greater than zero, equal to or
less than 32,767 and greater than the PATTERN
length.
offset....OPTIONAL. Numeric variable or constant which is the
offset within the TARGET for the search to begin.
The default is no offset so searching will start at
the first character in the TARGET. The first
character in the TARGET is at offset zero (0) so all
offsets are the actual character position in the
string minus one. Think of the offset as telling
the function to "ignore this many characters before
beginning the search." The length of the PATTERN
string plus this OFFSET must not exceed the length
of the TARGET string.
case......OPTIONAL. Logical variable or constant which
instructs the function to ignore case during the
search.
.T. DEFAULT. Forces the matching process
to adhere to case matching.
.F. Setting this flag to false (.F.)
instructs the function to ignore case
matching. Therefore, "The" and "the"
will be considered identical for
matching purposes.
Page #60
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDAT (cont'd)
Examples:
1. Search the TARGET text and return the position of every
occurrence of the word "the" and ignore case matching.
The function will find two occurrences, one at position
#01 and the other at position #33.
.
.
.
target = 'The quick brown fox jumped over the lazy dog.'
offset = 0
do while .T.
offset = WILDAT('the', target, offset, .f.)
if offset < 1
exit
endif
(do something)
enddo
.
.
.
The quick brown fox jumped over the lazy dog
^ ^
2. Search the TARGET text and return the position of every
occurrence of the pattern "t??t" and enforce case
matching. The function will find four occurrences, at
positions #16, #25, #32 and #35.
.
.
.
pattern = 't??t'
target = 'That guy gives tests on text with that book.'
offset = 0
do while .T.
offset = WILDAT(pattern, target, offset)
if offset < 1
exit
endif
(do something)
enddo
.
.
That guy gives tests on text with that book.
^ ^ ^ ^
Page #61
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDAT (cont'd)
3. Search the TARGET text and return the position of every
question mark (?). As this is the wildcard character
remember we must use the literal (\) expression. The
function will find two occurrences, one at position #13
and the other at position #24.
.
.
.
pattern = '\?'
target = 'Did you know? Does she?'
offset = 0
do while .T.
offset = WILDAT(pattern, target, offset)
if offset < 1
exit
endif
(do something)
enddo
.
.
.
Did you know? Does she?
^ ^
Returns:
memvar....Number variable which, if greater than zero,
indicates the position within the TARGET where the
PATTERN was found. This position is relative to the
start of the TARGET not the start of the
TARGET+OFFSET. If zero then no match was found. If
less than zero then an error in one of the
parameters prevented the search from beginning.
Cautions:
None.
Page #62
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDRAT
-------
The WILDRAT function will perform a search of a target string for
the first occurrence matching another string pattern but in a right
to left type search. The target string is searched in a right to
left manner looking for the first occurrence of the pattern string.
The pattern string may contain the wildcard character (?)
indicating a "don't care" for this position within the match. The
function also has the options of ignoring case during the match or
altering the offset within the target string for the scan to begin.
Format:
WILDRAT(pattern, target [,offset] [,case])
Parameters:
pattern...Character string variable or constant which is the
string to look for in the TARGET string. The
PATTERN length must be greater than zero, less that
32,767 and shorter than the TARGET length. The
following are special cases within the pattern.
? (wildcard) Indicates to the matching process
that it should ignore the character
in this position, but that a
character will exist in that
position. The PATTERN of "t??" will
match on all of the following
examples: "that", "test", "text" and
"with this". The last one will match
because of the .."th t.." matches the
wildcard pattern.
\ (literal) Indicates to the matching process
that it should take the next
character in the PATTERN literally.
This may be used when attempting to
match on the wildcard character
itself. For instance, a pattern of
"\?" will match in the phrase "Do you
understand?" when the question mark
is encountered. To match on the
backslash character (\) itself, just
precede it with a literal flag (eg.
"\\").
Page #63
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDRAT (cont'd)
target....Character string variable or constant which is the
string to search for the occurrence of PATTERN. The
TARGET length must be greater than zero, equal to or
less than 32,767 and greater than the PATTERN
length.
offset....OPTIONAL. Numeric variable or constant which is the
offset within the TARGET for the search to begin.
The default is no offset so searching will start at
the last character in the TARGET. The last
character in the TARGET is at offset zero (0) so all
offsets are the actual character position in the
string minus one. Think of the offset as telling
the function to "ignore this many characters before
beginning the search." The length of the PATTERN
string plus this OFFSET must not exceed the length
of the TARGET string.
case......OPTIONAL. Logical variable or constant which
instructs the function to ignore case during the
search.
.T. DEFAULT. Forces the matching process
to adhere to case matching.
.F. Setting this flag to false (.F.)
instructs the function to ignore case
matching. Therefore, "The" and "the"
will be considered identical for
matching purposes.
Page #64
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDRAT (cont'd)
Examples:
1. Search the TARGET text and return the position of every
occurrence of the word "the" and ignore case matching.
The function will find two occurrences, one at position
#13 and the other at position #45.
.
.
.
target = 'The quick brown fox jumped over the lazy dog.'
offset = 0
do while .T.
offset = WILDRAT('the', target, offset, .f.)
if offset < 1
exit
endif
(do something)
enddo
.
.
.
The quick brown fox jumped over the lazy dog
^ ^
2. Search the TARGET text and return the position of every
occurrence of the pattern "t??t" and enforce case
matching. The function will find four occurrences, at
positions #10, #13, #20 and #29.
.
.
.
pattern = 't??t'
target = 'That guy gives tests on text with that book.'
offset = 0
do while .T.
offset = WILDRAT(pattern, target, offset)
if offset < 1
exit
endif
(do something)
enddo
.
.
That guy gives tests on text with that book.
^ ^ ^ ^
Page #65
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved
PROCLIP2.LIB 2.00 User Documentation February 15, 1988
======================================================================
WILDRAT (cont'd)
3. Search the TARGET text and return the position of every
question mark (?). As this is the wildcard character
remember we must use the literal (\) expression. The
function will find two occurrences, one at position #01
and the other at position #12.
.
.
.
pattern = '\?'
target = 'Did you know? Does she?'
offset = 0
do while .T.
offset = WILDRAT(pattern, target, offset)
if offset < 1
exit
endif
(do something)
enddo
.
.
.
Did you know? Does she?
^ ^
Returns:
memvar....Number variable which, if greater than zero,
indicates the position within the TARGET where the
PATTERN was found. This position is relative to the
end of the TARGET not the end of the TARGET+OFFSET.
If zero then no match was found. If less than zero
then an error in one of the parameters prevented the
search from beginning.
Cautions:
None.
Page #66
Copyright (c) 1985-88 by Jason R. Matthews - All Rights Reserved